home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / manual-p / man_db-2.000 / man_db-2 / man_db-2.3.10 / GNUmakefile.in < prev    next >
Encoding:
Text File  |  1995-07-13  |  6.7 KB  |  220 lines

  1. # Master Makefile for the man_db package.
  2. #
  3. # Copyright (C) 1994, 1995, Graeme Wilford.
  4. #
  5. # You may distribute under the terms of the GNU General Public
  6. # License as specified in the COPYING file that comes with the man_db 
  7. # distribution.  
  8. #
  9. # Sat Aug  6 15:46:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
  10.  
  11. #------------------------------------------------------------------------#
  12. # You should not need to edit this file at all. All user options can now #
  13. # be passed via --enable-?, --disable-? or --with-? options to         #
  14. # ./configure.                                     #
  15. #                                     #
  16. # `./configure --help' shows current options available             #
  17. #                                     #
  18. # All system specific definitions are now in include/Defines.         # 
  19. #                                     #
  20. # path definitions are in include/manconfig.h                 #
  21. # compression related definitions are in include/comp_src.h         #
  22. #------------------------------------------------------------------------#
  23.  
  24. srcdir = @srcdir@
  25. VPATH = @srcdir@
  26. top_srcdir = @top_srcdir@
  27.  
  28. # GNUmakefile and include/Defines are automatic targets, don't add below.
  29. INCLUDES := $(addprefix include/, config.h manconfig.h comp_src.h)
  30. EVERYTHING = gencat lib xcat libdb src zsoelim nls man
  31. ALL = lib libdb src zsoelim nls man
  32. INSTALL = src zsoelim nls man
  33.  
  34. include include/Defines
  35.  
  36. .PHONY: $(DEFAULT_TARGETS) $(EVERYTHING) dist nls_defines ID \
  37.     $(addsuffix _root, $(DEFAULT_TARGETS)) update default RCS check
  38.         
  39. ifeq ($(nls),on)
  40. languages = $(notdir $(wildcard $(top_srcdir)/nls/*_*))
  41.  
  42. default: $(INCLUDES)
  43.     @echo " "
  44.     @echo "./configure has determined that your system understands native language"
  45.     @echo "support (nls) message catalogues.  This package is able to exploit this"
  46.     @echo "feature by displaying it's text messages in different languages on a per"
  47.     @echo "user basis.  British English is the default (built in) language."
  48.     @echo " "
  49.     @echo "Please issue make command with NLS language options (as shown below) or"
  50.     @echo "'make nls=off' to disable all native language support.  Currently the"
  51.     @echo "supported languages in POSIX 1003.1 locale format are:"
  52.     @echo " "
  53.     @for i in $(languages); do echo "    $$i"; done 
  54.     @echo "    "
  55.     @echo "To enable support for all of these locales issue 'make nls=all'"
  56.     @echo "To support only a subset of these locales, issue" 
  57.     @echo "'make nls=\"locale1 locale2 ...\"' (locales must be separated by spaces"
  58.     @echo "and the entire string quoted)"
  59.     @echo " "
  60.     @exit 0
  61.  
  62. all:
  63.     $(MAKE) nls=off
  64.  
  65. else # nls != on
  66.  
  67.   ifeq ($(nls),off)
  68.     ALL = lib libdb src zsoelim man
  69.     INSTALL = src zsoelim man
  70.   else # nls != off
  71.   endif # nls = off
  72.  
  73. all: $(ALL)
  74.     
  75. endif # nls = on
  76.  
  77. $(EVERYTHING): $(INCLUDES) nls_defines
  78.     $(MAKE) -C $@ $(targets)
  79.  
  80. # Automatic regeneration targets
  81. $(srcdir)/configure: configure.in aclocal.m4
  82.     -cd $(srcdir) && autoconf
  83.  
  84. $(srcdir)/include/config.h.in: stamp-h.in
  85. $(srcdir)/stamp-h.in: configure.in acconfig.h aclocal.m4
  86.     -cd $(srcdir) && autoheader && date > stamp-h.in
  87.  
  88. # Use CONFIG_FILES= CONFIG_HEADERS= to force config.status to only
  89. # re-create the relevant config file.
  90.  
  91. include/config.h: stamp-h
  92. stamp-h: $(srcdir)/include/config.h.in config.status
  93.     CONFIG_FILES= ./config.status
  94.     date > stamp-h
  95.  
  96. config.status: $(srcdir)/configure
  97.     ./config.status --recheck
  98.  
  99. # Allow sub-Makefiles to request update
  100. %: %.in config.status
  101.     CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
  102.  
  103. # The following 3 rules must be explicit as using a pattern match rule would
  104. # pick up include/config.h as a target which would be wrong.
  105.  
  106. include/manconfig.h: include/manconfig.h.in config.status
  107.     CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
  108.     
  109. include/comp_src.h: include/comp_src.h.in config.status
  110.     CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
  111.     
  112. include/Defines: include/Defines.in config.status
  113.     CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
  114.     
  115. # Special targets
  116. ID:
  117.     mkid $(foreach dir, . $(EVERYTHING), \
  118.         $(srcdir)/$(dir)/*.[chl] $(srcdir)/$(dir)/Makefile.in)
  119.  
  120. nls_defines:
  121.     cp include/Defines include/Defines.old
  122.     sed -e 's/^nls = .*/nls = $(nls)/' include/Defines.old > include/Defines
  123.  
  124. # Just make sure that all configure created files are up to date
  125. update: nls_defines $(INCLUDES) $(addsuffix /Makefile, $(ALL))
  126.  
  127. # testsuite doesn't exist
  128. testsuite:
  129.     @echo " "
  130.     @echo "The man_db testsuite was not found.  To perform a check of the installed"
  131.     @echo "programs, you must have the man_db testsuite package and DejaGNU, both"
  132.     @echo "available separately."
  133.     @echo " "
  134.     @exit 1
  135.     
  136. # Special loop-back root directory targets
  137. mostlyclean_root clean_root:
  138.     rm -f core *~ docs/*~ include/*~
  139.  
  140. distclean_root: clean_root
  141.     rm -f $(INCLUDES) include/Defines GNUmakefile makefile
  142.     rm -f include/Defines.old config.status config.cache config.log stamp-h
  143.  
  144. realclean_root: distclean_root
  145.     rm -f tags ID
  146.  
  147. TAGS_root:
  148.     $(MKTAGS) $(srcdir)/*.h include/*.h
  149.  
  150. # Normal targets and dependencies.
  151. # If the make variable clean is set to yes, no dependencies are re-created
  152.  
  153. install: $(INCLUDES) nls_defines
  154.  
  155. install uninstall:
  156.     for i in $(INSTALL); do $(MAKE) -C $$i $@; done
  157.  
  158. TAGS realclean distclean mostlyclean clean:
  159.     for i in $(EVERYTHING); do $(MAKE) -C $$i $@ clean=yes; done
  160.     $(MAKE) $@_root
  161.     
  162. check: testsuite testsuite/Makefile
  163.     $(MAKE) -C testsuite
  164.  
  165. ifeq ($(srcdir),.)
  166. # Sorry folks, can only make a dist from the $(srcdir)
  167.  
  168. # The files in the distribution
  169. _subdirs = $(EVERYTHING) tools docs include
  170.  
  171. _all = */README */Makefile.in
  172. _root = README configure *.h *.m4 *.in 
  173. _docs = INSTALL.* COPYING ChangeLog NEWS ToDo
  174. _gencat = *.[ch1] Copyright
  175. _include = *.in 
  176. _lib = *.[ch]
  177. _libdb = *.[ch] stamp-h COPYING.LIB
  178. _man = man?/*.man? */man?/*.man? THANKS
  179. _nls = nls.h *_*/*.m THANKS
  180. _src = README.lexgrog *.[chl] *.l-* man_db.config stamp-h
  181. _tools = checkman install-sh mandb_\[nt\]fmt-script mkcatdirs \
  182.      mkinstalldirs nroff-script
  183. _xcat = Register xcat.[cl]
  184. _zsoelim = *.[cl]
  185.  
  186. FILES = $(_root) $(_all) \
  187.     $(foreach _subdir, $(_subdirs), \
  188.       $(addprefix $(_subdir)/, $(_$(_subdir))))
  189.  
  190. message = release $(version), date $(date)
  191. nls_man = de_DE.88591 de_DE.ascii
  192. nls_cat = en_GB de_DE.88591
  193. man_db := man_db-$(version)
  194.  
  195. RCS:
  196.     ci -l -f$(rev) -m'$(message)' $(FILES)
  197.  
  198. # Ensure the flex C files and man_db-nls.h's are current
  199. dist: update
  200.     $(MAKE) -C src man_db-nls.h lexgrog.c nls=en_GB
  201.     $(MAKE) -C libdb man_db-nls.h nls=en_GB
  202.     $(MAKE) -C zsoelim zsoelim.c
  203.     $(MAKE) -C xcat xcat.c
  204.     rm -fr $(man_db)
  205.     rm -f $(man_db).tgz
  206.     mkdir $(man_db) 
  207.     mkdir $(addprefix $(man_db)/, $(_subdirs))
  208.     mkdir $(addprefix $(man_db)/nls/, $(nls_cat))
  209.     mkdir $(addprefix $(man_db)/man/, $(nls_man))
  210.     mkdir $(addprefix $(man_db)/man/, \
  211.             $(foreach dir, . $(nls_man), \
  212.               $(dir)/man1 $(dir)/man5 $(dir)/man8))
  213.     for file in $(FILES); do \
  214.       ln $(srcdir)/$$file $(man_db)/$$file; \
  215.     done
  216.     chmod -R a+rX $(man_db)
  217.     tar cvf - $(man_db) | gzip -9 > $(man_db).tgz
  218.     rm -fr $(man_db)
  219. endif
  220.